package com.qumap.common.event;

import com.google.gwt.event.shared.GwtEvent;

/**
 * Created by IntelliJ IDEA.
 * User: Admin
 * Date: 25.06.11
 * Time: 16:17
 * To change this template use File | Settings | File Templates.
 */
public class GlobalEventCollection {

    private static class GlobalEventType extends GwtEvent.Type<GlobalEventHandler> {}


    public static enum EventType {

        ShowUnsaved,
        ClearAll,
        Deactivate,
        Activate;

        private GwtEvent.Type<GlobalEventHandler> gwt_event_type = new GlobalEventType();

        public GwtEvent.Type<GlobalEventHandler> getType() {
            return gwt_event_type;
        }
    }

    private static final GlobalEventCollection self = new GlobalEventCollection();

    private GlobalEventCollection() {
    }

    public static GlobalEventCollection getCollection() {
        return self;
    }

    public GlobalEvent getEvent(EventType type) {
        return new GlobalEvent(type.getType());
    }



}
